3 USER_REGISTRATION=false
4 USER_REQUIREEMAIL=false
6 . "${_EXEC:-${0%/*}}"/cgilite/cgilite.sh
7 . "$_EXEC"/cgilite/session.sh nocookie
8 . "$_EXEC"/cgilite/users.sh
10 export MD_HTML="false"
11 if [ "$(which awk)" ]; then
12 markdown() { awk -f "$_EXEC/cgilite/markdown.awk"; }
14 markdown() { busybox awk -f "$_EXEC/cgilite/markdown.awk"; }
18 local check="$1"; shift 1;
20 if [ "$check" = "$comp" ] || [ "$check" -eq "$comp" ]; then
21 printf 'checked="checked"'
27 local check="$1"; shift 1;
29 if [ "$check" = "$comp" ] || [ "$check" -eq "$comp" ]; then
30 printf 'selected="selected"'
37 if [ ! "$USER_ID" ]; then
39 [form #user_login .login method=POST
41 [input name=uname placeholder="Username or Email" autocomplete=off]
42 [input type=password name=pw placeholder="Passphrase"]
43 [submit "action" "user_login" Login]
44 $([ "$USER_REGISTRATION" = true ] && printf '[a href="%s/register/" Register]' "$_BASE")
47 elif [ "$USER_ID" ]; then
49 [form #user_login .logout method=POST
50 [p Logged in as [span . $(HTML ${USER_NAME})]]
51 $([ "$USER_REGISTRATION" != true ] && printf '[a href="%s/invite/" Invite Friend]' "$_BASE")
52 [submit "action" "user_logout" Logout]
59 title="${1:-RAW:NET}" page="$2"
60 printf '%s\r\n' 'Content-Type: text/html; charset=utf-8' \
61 "Content-Security-Policy: script-src 'none'" \
66 [meta name="viewport" content="width=device-width"]
67 [link rel="stylesheet" type="text/css" href="$_BASE/cgilite/common.css"]
68 [link rel="stylesheet" type="text/css" href="$_BASE/rawnet.css"]
69 [title . $(HTML "$title")]
72 [form method=POST action="$_BASE/search/"
73 [input name=search placeholder="Search"]
80 } |"$_EXEC/cgilite/html-sh.sed" -u
84 /favicon.ico) printf '%s\r\n' 'Content-Length: 0' '';;
86 . "${_EXEC}/cgilite/file.sh"
87 FILE "${_EXEC}/${PATH_INFO}"
90 if [ "$USER_ID" ]; then
93 yield_page 'RAW:NET Login' login <<-EOF
99 if [ "$USER_ID" -a "$(GET user_register)" = confirm ]; then
100 printf 'Refresh: 2; url=%s\r\n' "/${_BASE#/}"
101 yield_page "RAW:NET Register confirm" "message register_confirm" <<-EOF
102 User registration successful!
106 yield_page 'RAW:NET Register User' register <<-EOF
111 yield_page 'RAW:NET Recover Account' recover <<-EOF
116 if [ "$USER_ID" -a "$(GET user_register)" = confirm ]; then
117 printf 'Refresh: 2; url=%s\r\n' "/${_BASE#/}"
118 yield_page "RAW:NET Account activation" "message invite_confirm" <<-EOF
119 Account activation successful!
123 yield_page 'RAW:NET Invite User' invite <<-EOF
124 [nav [a href="../" Channels] - [span Invite]]
128 /video/*/*.mp4|/video/*/*.webm|/video/*/*.jpg)
129 . "${_EXEC}/cgilite/file.sh"
130 FILE "${_DATA}/${PATH_INFO#/video/}"
132 /|/channel/*) . "${_EXEC}/page_channel.sh";;
133 /playlist/*) . "${_EXEC}/page_playlist.sh";;
134 /search/*) . "${_EXEC}/page_search.sh";;
135 *) . "${_EXEC}/page_404.sh";;